@import url(./common/global.less);

.ct-chatbox {
  --bg-color: #dde3e7;
  display: flex;
}

.ct-chatbox__outer {
  display: flex;
  .ct-chatbox__avatar {
    img {
      max-width: 60px;
      border-radius: 50%;
    }
  }
}

.ct-chatbox__inner {
  .ct-chatbox__name {
    font-size: 12px;
    margin-bottom: 10px;
  }
  .ct-chatbox__main {
    position: relative;
    border-radius: 5px;
    padding: 10px;
    background-color: var(--bg-color);
    .ct-chatbox__stamp {
      margin-top: 10px;
      font-size: 12px;
    }
    &:not(&:last-of-type) {
      margin-bottom: 10px;
    }
  }
}

.ct-chatbox__left {
  .ct-chatbox__outer {
    .ct-chatbox__avatar {
      margin-right: 15px;
    }
  }
  .ct-chatbox__first::before {
    content: "";
    position: absolute;
    left: -20px;
    border: 10px solid var(--bg-color);
    border-left-color: transparent;
    border-top-color: transparent;
    border-bottom-color: transparent;
  }
}

.ct-chatbox__right {
  flex-direction: row-reverse;
  .ct-chatbox__outer {
    flex-direction: row-reverse;
    .ct-chatbox__avatar {
      margin-left: 15px;
    }
  }
  .ct-chatbox__first::after {
    content: "";
    position: absolute;
    top: 15px;
    right: -20px;
    border: 10px solid var(--bg-color);
    border-right-color: transparent;
    border-top-color: transparent;
    border-bottom-color: transparent;
  }
}
